﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Common.Library;
using OnlineVideos.Data;
using OnlineVideos.View_Models;
using Common.Utilities;
using OnlineVideos.UI;
using System.Windows.Navigation;


namespace OnlineVideos
{
    public partial class DownloadDetails : PhoneApplicationPage
    {
        public DownloadDetails()
        {
            InitializeComponent();
            if (AppSettings.ShowID != "0")
            {
                LoadPivotThemes(AppSettings.ShowUniqueID);
            }
        }
        private void LoadPivotThemes(long ShowID)
        {
           
            pvtMainDetails.Background = ShowDetail.LoadShowPivotBackground(ShowID);
            tblkVideosTitle.Text = OnlineShow.GetShowDetail(AppSettings.ShowUniqueID).Title;
        }
        private void LoadAds()
        {
            try
            {
                PageHelper.LoadAdControl(LayoutRoot, adstackpldetails);

            }
            catch (Exception ex)
            {
                Exceptions.SaveOrSendExceptions("Exception in LoadAds Method In SongDetails file", ex);
                string excepmess = "Exception in LoadAds Method In SongDetails file.\n\n" + ex.Message + "\n\n StackTrace :- \n" + ex.StackTrace;
            }
        }

        private void imgTitle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            NavigationService.Navigate(NavigationHelper.MainPanoramaPage);
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (VideosList.lbxSongsList.IsEnabled == false)
                VideosList.lbxSongsList.IsEnabled = true;
            //YouTube.CancelPlay();
        }
    }
}